KERNELDIR := /home/Linux/kernel/ebf_linux_kernel_6ull_depth1/build_image/build
CURRENT_PATH := $(shell pwd)
ARCH=arm
CROSS_COMPILE=arm-linux-gnueabihf-
#导入环境变量
export  ARCH  CROSS_COMPILE  

# 特殊变量 指定要编译为模块的对象文件
obj-m := gpioled.o 
# 构建规则 kernel_modules和gpioledApp为两个目标
build: kernel_modules gpioledApp

kernel_modules:
	$(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) modules

gpioledApp: gpioledApp.c
	arm-linux-gnueabihf-gcc gpioledApp.c -o gpioledApp
clean:
	$(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH)  clean
	rm -rf gpioled gpioledApp

